package com.test.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.test.mapper.TreeMapper;
import com.test.model.Tree;
import com.test.service.TreeService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.beans.Transient;
import java.util.List;

@Service
public class TreeServiceImpl extends ServiceImpl<TreeMapper, Tree>
        implements TreeService {


    @Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
    @Override
    public List<Tree> getTree() {
        Tree tree = this.getBaseMapper().selectById(1);
        System.out.println(tree);
        return this.getBaseMapper().selectList(null);
    }
}
